<?php


namespace App\HttpController\Api;


use App\Crontab\MessageTask;
use App\Utility\ReverseProxyTools;

class Wechat extends Login
{

    public function config()
    {
        $url = str_replace('&amp;', '&', $this->request()->getRequestParam('url'));
        //var_dump($url);
        $wechat = new \App\Model\Wechat();
        $client = $wechat->GetClient();
        $jsApi = $client->officialAccount()->jsApi();
        $jsApiSignaturePack = $jsApi->sdk()->signature($url);
        $this->success($jsApiSignaturePack);
    }

    public function test()
    {
        //MessageTask::setTestJob();
        //MessageTask::testsend();
        //MessageTask::mytask();

        //IP
        //$ip = ReverseProxyTools::checkCurrentClientIP($this->request());

        //var_dump($ip);

    }
}